#!/usr/bin/env python
# -*- conding: utf-8 -*-

"""
@Time     : 2024/9/4 6:01
@Author   : liujingmao
@File     : 3.GenericLoader示例.py
"""

from langchain_community.document_loaders.generic import GenericLoader

loader = GenericLoader.from_filesystem(".", glob="*.txt", show_progress=True)

for idx, doc in enumerate(loader.lazy_load()):
    print(f"当前正在加载第{idx + 1}个文件，文件名:{doc.metadata['source']}")
